export function getDeviceId(): string {
  let deviceId = localStorage.getItem('device_id');
  if (!deviceId) {
    let uid = '';
    for (let i = 0; i < 9; i++) {
      uid += Math.floor(Math.random() * 10); // 生成 0-9 的随机数字
    }
    deviceId = uid;
    localStorage.setItem('device_id', deviceId);
  }
  return deviceId;
}
